from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC



class BasePage(object):
    def __init__(self,driver):
        self.driver = driver
        self.__url = None

    def find_element(self,*loc):
        try:
            WebDriverWait(self.driver,10,0.5).until(EC.visibility_of_element_located(loc))
            return self.driver.find_element(*loc)
        except:
            print(*loc+"元素定位再页面中无法找打")

    def get_titleText(self):
        return self.driver.title